﻿@using Microsoft.AspNet.Identity
@model BestQA.QueryService.DTOs.QuestionDTO

@{
    ViewBag.Title = "Details";
}

<div ng-controller="PostDetailController">
    <div>
        <div class="post_title">
            @Model.Title
        </div>
        <div class="post-item-header">
            <div class="pull-left">
                <span>#楼主</span>
                <span style="margin-right:5px">@Model.CreatedTime</span>
                @if (!string.IsNullOrEmpty(Model.UserId))
                {
                    @Html.ActionLink(Model.UserId, "index", new { userId = Model.UserId })
                }
            </div>
            <div class="pull-right">
                @if (Model.UserId == User.Identity.GetUserName())
                {
                    <a href="#" ng-click="showEditPostDialog()" style="margin-left:5px">编辑</a>
                    <a href="#" ng-click="#" style="margin-left:5px">结帖</a>
                }
                @if (Request.IsAuthenticated)
                {
                    <a href="#" ng-click="showNewReplyDialog()">回复</a>
                }
            </div>
        </div>
        <div class="post-item-body">
            @Model.Content
        </div>
    </div>
</div>

<p>
    @Html.ActionLink("Edit", "Edit", new { id = Model.Id }) |
    @Html.ActionLink("Back to List", "Index")
</p>
